﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace PayPal
{

    public class Global : System.Web.HttpApplication
    {
        private static TraceSource _source = new TraceSource("ReferenceWebApplication");

        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            //profile the life of .aspx pages
            //if (Request.Path.EndsWith(".aspx", StringComparison.InvariantCultureIgnoreCase))
            //{
            //    _source.TraceEvent(TraceEventType.Start, 0, Request.RawUrl);
            //}

        }

        protected void Application_EndRequest(object sender, EventArgs e)
        {
            //profile the life of .aspx pages
            //if (Request.Path.EndsWith(".aspx", StringComparison.InvariantCultureIgnoreCase))
            //{
            //    _source.TraceEvent(TraceEventType.Stop, 0, Request.RawUrl);
            //}
        } 

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {
            _source.TraceData(TraceEventType.Error, 0, this.Server.GetLastError());

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}